﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ked
{
    class AtomicInt
    {
        private volatile int mValue;

        public int IncreaseAndGet()
        {
            lock (this)
            {
                mValue++;
                return mValue;
            }
        }

        public int DecreaseAndGet()
        {
            lock (this)
            {
                mValue--;
                return mValue;
            }
        }
    }
}
